/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.product.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.S100;
import queenb.web.util.PackageContants;

/**
 *
 * @author Nguyen Hung
 */
public class S100Store extends S100 {

    public List<S100> LISTOFTABS100(int pnFH000, int pnFH200, int pnFS200, String pvLOGIN) {

        DataStatement dataStatement = new DataStatement(PackageContants.LIST_S100, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFH000),
                    new Param(OracleTypes.INTEGER, pnFH200),
                    new Param(OracleTypes.INTEGER, pnFS200),
                    new Param(OracleTypes.CHAR, pvLOGIN),});
        try {
            return super.find(dataStatement, S100.class);
        } catch (SQLException ex) {
            Logger.getLogger(S100Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (InstantiationException ex) {
            Logger.getLogger(S100Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        } catch (IllegalAccessException ex) {
            Logger.getLogger(S100Store.class.getName()).log(Level.SEVERE, null, ex);
            return null;
        }
    }
    //

    public int STORNOTABS100(int pnPS100, String pvLOGIN) {
        try {

            DataStatement dateStatement = new DataStatement(PackageContants.DELETE_S100, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPS100),
                        new Param(OracleTypes.CHAR, pvLOGIN),});
            return super.update(dateStatement, null);
        } catch (SQLException ex) {
            Logger.getLogger(S100Store.class.getName()).log(Level.SEVERE, null, ex);
            return -1;
        }
    }
//

    public int INSERTTABS100(int pnPS100, int pnFH000,
            int pnFH200,
            int pnFS200,
            int pnSN101,
            int pnSN102,
            int pnSN103,
            int pnSN104,
            int pnSN105,
            int pnSN106,
            int pnSN107,
            int pnCN108,
            int pnCN109, String pvSV110, String pvLOGIN) {
        try {
            DataStatement dateStatement = new DataStatement(PackageContants.UPDATE_S100, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPS100),
                        new Param(OracleTypes.INTEGER, pnFH000),
                        new Param(OracleTypes.INTEGER, pnFH200),
                        new Param(OracleTypes.INTEGER, pnFS200),
                        new Param(OracleTypes.INTEGER, pnSN101),
                        new Param(OracleTypes.INTEGER, pnSN102),
                        new Param(OracleTypes.INTEGER, pnSN103),
                        new Param(OracleTypes.INTEGER, pnSN104),
                        new Param(OracleTypes.INTEGER, pnSN105),
                        new Param(OracleTypes.INTEGER, pnSN106),
                        new Param(OracleTypes.INTEGER, pnSN107),
                        new Param(OracleTypes.INTEGER, pnCN108),
                        new Param(OracleTypes.INTEGER, pnCN109),
                        new Param(OracleTypes.CHAR, pvSV110),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dateStatement, null);


        } catch (SQLException ex) {
            Logger.getLogger(S100Store.class.getName()).log(Level.SEVERE, null, ex);

            return -1;
        }

    }
}
